Augment audio system with the ability to have captions #5567
Open
sowelipililimute wants to merge 2 commits intospace-wizards:masterfrom
Open
Augment audio system with the ability to have captions #5567sowelipililimute wants to merge 2 commits intospace-wizards:masterfrom
sowelipililimute wants to merge 2 commits intospace-wizards:masterfrom
Conversation
975a9d9 to
e710d6a
Compare
1d44d43 to
b068a43
Compare
f9453c9 to
7eb4fe9
Compare
2 tasks
metalgearsloth
suggested changes
May 10, 2025
7eb4fe9 to
0e5304d
Compare
0e5304d to
c355575
Compare
|
|
||
| private void OnAudioPaused(EntityUid uid, AudioComponent component, ref EntityPausedEvent args) | ||
| { | ||
| if (_captionQuery.TryGetComponent(uid, out var caption) && EntityManager.TryGetComponent(uid, out TransformComponent? xform)) |
Member
There was a problem hiding this comment.
No need to do a TryComp for the TransformComponent, all entities have that component.
And if it was deleted the first one would fail.
So you can just use the Transform(uid) shorthand, which uses a query
| public sealed partial class CaptionComponent : Component, IComponentTreeEntry<CaptionComponent> | ||
| { | ||
| [DataField, AutoNetworkedField] | ||
| public LocId? Caption { get; set; } |
Member
There was a problem hiding this comment.
add documentation to all of these
| public string ID { get; private set; } = default!; | ||
|
|
||
| [DataField] | ||
| public LocId? Caption { get; private set; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Mainly manages
CaptionComponents attached to the audio entities whenever they should display a visible caption. Can't use aCaptionfield on theAudioComponentdue to theComponentTreeSystemwanting to listen to theComponentStartup/ComponentShutdownevents that are already being listened to by the clientAudioSystem.